/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 LifecycleControlParams.cpp. Created on: 13.10.2009 17:33:08
 */

#include "smartobjects/core/LifecycleControlParams.hpp"

namespace smartobjects {

const unsigned long LifecycleControlParams::DEFAULT_MAX_LAST_ACTIVITY_AWAIT_TIME =  30 * 60 * 1000; // 1800 seconds = 30 min

LifecycleControlParams::LifecycleControlParams() :
		m_bDestroyByLastActivityTime(false),
		m_bDestroyByRemoteConnectionClosed(true),
		m_nMaxLastActivityAwaitTime (DEFAULT_MAX_LAST_ACTIVITY_AWAIT_TIME),
		m_bAvailableByInstanceIdForAll(false) {
}

LifecycleControlParams::~LifecycleControlParams() {
}

void LifecycleControlParams::setDestroyByLastActivityTime(bool bValue) {
	m_bDestroyByLastActivityTime = bValue;
}

bool LifecycleControlParams::isDestroyByLastActivityTime() {
	return m_bDestroyByLastActivityTime;
}

void LifecycleControlParams::setDestroyByRemoteConnectionClosed(bool bValue) {
	m_bDestroyByRemoteConnectionClosed = bValue;
}

bool LifecycleControlParams::isDestroyByRemoteConnectionClosed() {
	return m_bDestroyByRemoteConnectionClosed;
}

void LifecycleControlParams::setMaxLastActivityAwaitTime(unsigned long nValue) {
	m_nMaxLastActivityAwaitTime = nValue;
}

unsigned long LifecycleControlParams::getMaxLastActivityAwaitTime() {
	return m_nMaxLastActivityAwaitTime;
}

void LifecycleControlParams::setAvailableByInstanceIdForAll(bool bValue) {
	m_bAvailableByInstanceIdForAll = bValue;
}

bool LifecycleControlParams::isAvailableByInstanceIdForAll() {
	return m_bAvailableByInstanceIdForAll;
}

}
